<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>jQuery UI Tabs - Default functionality</title>
        <jsp:include page="commons/commoncss.jsp"/>
       	
       	<jsp:include page="commons/commonjs.jsp" />
       	
        <script type="text/javascript">
		function login(){
			var user = "admin";
			var pass = "admin123";
			if(document.frm.username.value == ""||document.frm.password.value == ""){
				alert("The username and password cannot be blank!");
				return false;
			}
			if(document.frm.username.value == user && document.frm.password.value != pass){
			alert("Password is incorrect! Try again!");
			document.frm.password.value="";
			return false;
			}
			if(document.frm.username.value !=user){
				alert("The username isn't existed!");
				document.frm.username.value="";
				document.frm.password.value="";
				return false;
			}
		};
		</script>
    </head>
	<body>
            <div id="content">
                <div style="width: 40%; margin: 25% 30%;">
                    <div id="maincontentheader">
                        Welcome!
                    </div>
                    <div id="tabs">
                        <div class="ui-tabs-panel">
                        <s:form action="login.action" method="post">
						<s:textfield name="userName" size="20" key="lbl.login.username"></s:textfield>
						<s:password name="password" size="20" key="lbl.login.password"></s:password>
						<s:submit method = "checkLogin" align="center" key="lbl.login.submit"></s:submit>
						</s:form>
						<s:actionerror/>
						<a href = "recover_password.jsp">Forgot password</a>
                        </div>
                    </div>
                </div>    
        </div>
    </body>
</html>

